package com.myteam.mystory.adapter;

import com.myteam.mystory.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class ChapterAdapter extends ArrayAdapter<String> {
	private Context context;
	private String[] chapterstory;
	
	private TextView tvname_chapter;
	private TextView statut_chapter;
	private ImageView img_chapter;

	public ChapterAdapter(Context context, int resource, String[] objects) {
		super(context, resource, objects);
		this.context = context;
		chapterstory = new String[]{"adfasgf","agđgadf","agfdsagag","agfhagfd","agfag","agfah","agfahg","agah","aghadhf","agfah"};
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View rowView = inflater.inflate(R.layout.chapter_adapter, parent,false);
		tvname_chapter = (TextView) rowView.findViewById(R.id.chapter_name);
		statut_chapter = (TextView) rowView.findViewById(R.id.chapter_statut);
		img_chapter = (ImageView) rowView.findViewById(R.id.chapter_img);
		tvname_chapter.setText(chapterstory[position]);
		return rowView;
	}
	//hoangkien

}
